import fetch from '@system.fetch';
import router from '@system.router';

export default {
    data: {
        title: "",
        msg: "哈哈哈",
        formData:{
            "LoginID": "gzmdjlry1",
            "Password": "gzmd#001",
            "ZhuanYeId": 0,
            "PhoneIMEI": "01801A89A0AD4418F2A8A16C414BD73867622F06",
            "WorkPhone": "15000000001"
        },

    },
    onInit() {
        router.push({
            uri:'pages/login/login'
        })
        console.info("初始化")
        //请求地址
        const URL = "http://218.107.49.182:40837/WebAPI/App.ashx?"
        //请求标志
        const module="module=login"
        //请求参数
        const param="param="+escape(JSON.stringify(this.formData))

        fetch.fetch({
            url: URL+module+'&'+param,//拼接请求
            responseType: "json",
            success: res => {
                console.info("成功")
                console.info(JSON.stringify(res))
            },
            fail: err => {
                console.info("失败" + JSON.stringify(err))
            },
            complete: v => {
                console.info("结束")
            }
        })
    }
}
